package com.itbaizhan.dao;


import com.itbaizhan.entity.MembersInfo;
import org.junit.Test;
import org.junit.runner.RunWith;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:applicationContext-dao.xml"})
public class test {
    @Autowired
    private MembersInfoDao membersInfoDao;
    @Test
    public void findAll(){
        System.out.println(membersInfoDao.findAll());
    }

    @Test
    public void findById(){
        System.out.println(membersInfoDao.findById(1));
    }

    @Test
    public void update(){
        MembersInfo membersInfo = MembersInfo.builder()
                .id(3)
                .mname("chenzhuo")
                .mage(18)
                .maddress("上海")
                .memail("chenzhuo@163.com")
                .mgender("男")
                .build();
        System.out.println(membersInfoDao.updateByMembersInfo(membersInfo));
    }

}
